#pragma once
#include "ServerProxy.h"
class CDatabaseProxy	: public CServerProxy
{
public:
	CDatabaseProxy(void);
	~CDatabaseProxy(void);

	void Connect( xgc_lpcstr address, xgc_uint16 port, xgc_uint16 test_invent, xgc_uint16 timeout );
	void Disconnect();

	operator net::network_t()const{ return mLink; }
	net::network_t getlink(){return mLink; }
protected:
	virtual void RegisteMessage();
	virtual xgc_lpvoid OnConnect( net::network_t h, xgc_lpvoid p );
	virtual void OnClose( xgc_lpvoid userdata );
	
	xgc_void ProcessCheck( net::network_t h, xgc_lpvoid u, const xgc_byte* data, xgc_size size );
private:
	xgc_void UserLoginResult( net::network_t h, xgc_lpvoid u, const xgc_byte* data, xgc_size size );
	xgc_char *CreatSession(const char *str_name);
private:
	net::network_t mLink;
};

